<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return['setting']=$this->plugin_setting('basic');
if($_RQ['op']=='main'){
	$_SESSION['forward_url']='jy_farmer/myhome/';
	unset($_SESSION['logout_forward']);
	$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
	cfc('core')->checklogin();
	$return=array();
	$return['item']=model('core/member')->detail($_SESSION['uid'],array('id','credit1','credit2','credit3','credit4','credit5','credit6','mobile','avatar','nickname'));
	if(!$return['item']){
		exi('找不到会员信息！','error');
	}
	if($return['item']['groupid']){
		$return['item']['group']=pdo_getcolumn('core_member_groups',array('id'=>$return['item']['groupid'],'uniacid'=>$_SESSION['uniacid']),'title');
	}else{
		$return['item']['group']='普通会员';
	}
	$addressinfo=pdo_get('core_address',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid'],'isdefault'=>1));
	$return['item']['ideal_money']=pdo_getcolumn('core_ideal_money',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'money');
	$credit_types=credit_types();
	$credit_types2=array();
	foreach($credit_types as $key=>$value){
		$fee=$return['item']['credit'.$key];
		$credit_types2[$key]=array(
			'id'=>$key,
			'title'=>$value,
			'fee'=>$fee
		);
	}
	$return['credit_types']=$credit_types2;
	$worker=pdo_get('jy_farmer_worker',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'id');
	if($worker['id']){
		$return['isworker']=1;
	}
	set_html('title','会员中心');
	exi($return);
	
}
		
?>